package gui;

import javax.swing.JFrame;

import control.Core;
import control.render.RenderController;

public class MainWindow extends JFrame{
  private static final long serialVersionUID = -7813692869569178350L;
  private Core core;
  private RenderController renderController;

  public MainWindow(Core core){
    this.core = core;
    setSize(
        core.getRenderSetup().getWidth() + 16, 
        core.getRenderSetup().getHeight() + 38);
    initialize();
  }
  
  private void initialize(){
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    setTitle("My Renderer");
    
    getContentPane().add(getRenderController().getRenderPanel());
  }
  
  public RenderController getRenderController(){
    if(renderController == null){
      renderController = new RenderController(core);
    }
    return renderController;
  }
}
